; jmc-lisp-fp-trace.cl

; Tested with GNU CLISP
; http://clisp.cons.org/

; http://www.paulgraham.com/rootsoflisp.html
; http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp

(load "jmc.lisp")
(trace eval.)
; p9

(defparameter a
 '(
   (filter 
    (lambda (f l)
     (cond ((eq l '()) '())
           ((f (car l)) (cons (car l) (filter f (cdr l))))
           ('t (filter f (cdr l))))))
  )
)

(print (list
 (equal
  (eval. '((lambda (x y) (cons x (cdr y)))
         'a
         '(b c d))
         '())
  '(a c d)
 )
 (equal 
  (eval. '(f g) '((f (lambda (x) x)) (g (lambda () 'foo))))
  '(lambda () 'foo)
 )
 (equal 
  (eval. '(f g) '((f (lambda (x) (x))) (g (lambda () 'foo))))
  'foo
 )
 (equal
  (eval. '(filter 'car '((t foo) (() bar))) a)
  '((t foo))
 )
))
